package com.limetalks.data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@NamedQueries({
	@NamedQuery(name="findCommentsByStream", query="SELECT c FROM Comment c where c.stream = :streamId")
})
@Table(name = "comment")
public class Comment {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "comment_id")
	private Integer id;

	private String text;
	private Integer author;
	private Integer stream;
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getAuthor() {
		return author;
	}
	
	public void setAuthorId(Integer author) {
		this.author = author;
	}
	
	public Integer getStream() {
		return stream;
	}
	
	public void setStreamId(Integer stream) {
		this.stream = stream;
	}
	
	public String getText() {
		return text;
	}
	
	public void setText(String text) {
		this.text = text;
	}
}
